// -*- c++ -*-
// Copyright 2008 Isis Innovation Limited
//
// System.h
//
// Defines the System class
//
// This stores the main functional classes of the system, like the
// mapmaker, map, tracker etc, and spawns the working threads.
//
#ifndef __SYSTEM_H
#define __SYSTEM_H
#include "GLWindow2.h"
#include "px.h"
#include "Scarf.h"
#include "PxSharedMemClient.h"
#include "SE3GaussianPDF.h"
#include "Tracker.h"
#include "mavlink.h"
#include <TooN/so3.h>
#include <TooN/se3.h>
#include <cvd/image.h>
#include <cvd/rgb.h>
#include <cvd/byte.h>
#include <opencv/cv.h>
#include <time.h>
#include <sys/timeb.h>

class ATANCamera;
class MapMaker;
class MapViewer;

class System
{
public:
  System(bool bUseGUI = true);
  ~System();
  bool NewObservations(const mavlink_message_t* encoded_msg, SE3GaussianPDF &se3PdfGfromC);
  bool Stop() { return mbDone; };
  bool UsingGUI() { return mbUseGUI; };

private:
  Scarf *mpScarf;
  PxSharedMemClient *mpSharedMemClient;
  GLWindow2 *mGLWindow;  
  MapMaker *mpMapMaker; 
  Tracker *mpTracker; 
  ATANCamera *mpCamera;
  MapViewer *mpMapViewer;
  IplImage *mpIplImage;
  CVD::Image<CVD::Rgb<CVD::byte> > mimFrameRGB;
  CVD::Image<CVD::byte> mimFrameBW;
  CVD::ImageRef mirFrameSize;

  bool mbDone;
  bool mbUseGUI;

  static void GUICommandCallBack(void* ptr, std::string sCommand, std::string sParams);
};




#endif
